CREATE TABLE [dbo].[TCCANJ_PROV]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[CO_PROV] [dbo].[TD_VC_020] NOT NULL,
[NU_CANJ] [dbo].[TD_VC_008] NOT NULL,
[FE_CANJ] [dbo].[TD_DT_001] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NOT NULL,
[CO_MONE] [dbo].[TD_VC_003] NOT NULL,
[DE_OBSE] [dbo].[TD_VC_100] NULL,
[FA_TIPO_CAMB] [dbo].[TD_NU_015_006] NOT NULL CONSTRAINT [DF__TCCANJ_PR__FA_TI__7C4F7684] DEFAULT ((1.000)),
[FE_INIC_VCMTO] [dbo].[TD_DT_001] NULL,
[NU_LETR_GENE] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCCANJ_PR__NU_LE__7D439ABD] DEFAULT ((0)),
[ST_CONT] [dbo].[TD_VC_001_INTE] NOT NULL CONSTRAINT [DF__TCCANJ_PR__ST_CO__7E37BEF6] DEFAULT ('N'),
[ST_PLAZ_VMTO] [dbo].[TD_VC_001] NULL,
[ST_CANJ] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TCCANJ_PR__ST_CA__00200768] DEFAULT ('N'),
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCCANJ_PR__NU_PR__02084FDA] DEFAULT ((0)),
[NU_DIAS_PLAZ] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCCANJ_PR__NU_DI__02FC7413] DEFAULT ((0)),
[NU_DIFE_DIAS] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCCANJ_PR__NU_DI__03F0984C] DEFAULT ((0)),
[ST_FECH_VMTO] [dbo].[TD_VC_001] NULL,
[TI_SITU] [dbo].[TD_VC_003] NOT NULL,
[FE_INIC_VMTO] [dbo].[TD_DT_001] NULL,
[NU_DIAS_MESE] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCCANJ_PR__NU_DI__04E4BC85] DEFAULT ((0)),
[ST_DIAS_FMES] [dbo].[TD_VC_001] NULL,
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCCANJ_PR__CO_US__05D8E0BE] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCCANJ_PR__FE_US__06CD04F7] DEFAULT (getdate()),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCCANJ_PR__CO_US__07C12930] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCCANJ_PR__FE_US__08B54D69] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCCANJ_PROV] WITH NOCHECK ADD CONSTRAINT [CK__TCCANJ_PR__ST_CA__01142BA1] CHECK NOT FOR REPLICATION (([ST_CANJ]='N' OR [ST_CANJ]='S'))
GO
ALTER TABLE [dbo].[TCCANJ_PROV] WITH NOCHECK ADD CONSTRAINT [CK__TCCANJ_PR__ST_CO__7F2BE32F] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TCCANJ_PROV] ADD CONSTRAINT [PK__TCCANJ_P__77CB01397E188EBC] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [CO_PROV], [NU_CANJ], [FE_CANJ]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCCANJ_PROV] ADD CONSTRAINT [FK__TCCANJ_PR__CO_EM__7AF2094E] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
ALTER TABLE [dbo].[TCCANJ_PROV] ADD CONSTRAINT [FK__TCCANJ_PROV__7BE62D87] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
